package com.meilai.project.mapper.media;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.meilai.project.entity.media.MediaPointChooseDaterange;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 选位集合-时间段 Mapper 接口
 * </p>
 *
 * @author 张驰
 * @since 2022-01-25
 */
@Mapper
public interface MediaPointChooseDaterangeMapper extends BaseMapper<MediaPointChooseDaterange> {

	@Delete("delete from media_point_choose_daterange where choose_id = #{chooseId} ")
	int deleteByChooseId(@Param("chooseId") Long chooseId);

	@Select("select * from media_point_choose_daterange where choose_id = #{chooseId} ")
	List<MediaPointChooseDaterange> listByChooseId(@Param("chooseId") Long chooseId);

	List<MediaPointChooseDaterange> listByDaterangeIdList(@Param("daterangeIdList") List<Long> chooseIdList );

	@Select("select id from media_point_choose_daterange where choose_id = #{chooseId}")
	Long queryDaterangeIdByChooseId(@Param("chooseId") Long chooseId);

}
